

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>角色管理</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <#include "../../include/layui.ftl" />
    <#include "../../include/pTable.ftl" />
</head>
<body>

<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-form layui-card-header layuiadmin-card-header-auto">
            <form  id="queryForm">
                <input type="hidden" id="className" name="className" value="${className!}" />
                <input type="hidden" id="modleName" name="modleName" value="${modleName!}" />
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">角色名称</label>
                        <div class="layui-input-block">
                            <input type="text" name="roleName" placeholder="请输入" autocomplete="off" class="layui-input">
                            <input type="hidden" name="roleName_searchType" value="like">
                        </div>
                    </div>
                </div>
            </form>
        </div>

        <div class="layui-card-body">
            <table id="lay-table" lay-filter="lay-table"></table>
            <script type="text/html" id="toolbar">
            </script>
        </div>
    </div>
</div>
<script>
    layui.config({
        base: '${path}/plug-in/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index','tables','layers','view'],function () {
        var tables = layui.tables,
            table = layui.table,
            view = layui.view,
            layer = layui.layer,
            layers = layui.layers,
            $ = layui.$;
        var parmer = {
            url:'/console/role/rewrite/list',
            cols:[[
                    {field:"roleName",width:200,title:"角色名称"}
                    ,{field:"roleDesc",width:200,title:"角色描述"}
                    ,{field:"nickName",width:200,title:"创建帐号"}
                ]]
        };
        var $tables = tables.renderTable(parmer);

        //头工具栏事件
        table.on('toolbar(lay-table)', function(obj){
            switch(obj.event){
                case '01':
                    layers.add({
                        area:['400px', '270px']
                    });
                    break;
                case '02':
                    layers.edit({
                        area:['400px', '270px'],
                        data: p.data
                    });
                    break;
                case '03':
                    layers.delete({url:"/console/role/rewrite/delete",data:p.data});
                    break;
                case '05':
                    var where = $("#queryForm").serializeObject();
                    $tables.reload({
                        where: where,
                        text: {none: '暂无数据！'}
                    });
                    break;
                case '26':
                    layers.edit({
                        title:'菜单动作配置',
                        area:['900px', '600px'],
                        content:'/console/role/rewrite/config?id='+p.data.id,
                        data: p.data
                    });
                    break;
            };
        });
    });
</script>
</body>
</html>